package com.wx.resume_excel.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wx.resume_excel.dao.ExcelResumeDao;
import com.wx.resume_excel.model.JobSeeker;
import com.wx.resume_excel.model.ResumeTemplate;
import com.wx.resume_excel.model.SelectModel;
import com.wx.resume_excel.service.ExcelResumeService;
import com.wx.resume_excel.vo.JobSeekerVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * excelResume的service层接口的实现类
 *
 * @Auther 田艺鹏
 * @DateTime 2020-08-03 10:49
 */
@Service("excelResumeServiceImpl")
public class ExcelResumeServiceImpl implements ExcelResumeService {
    @Autowired
    private ExcelResumeDao excelResumeDao;

    @Override
    public int addJobSeeker(JobSeeker jobSeeker) {
        return excelResumeDao.addJobSeeker(jobSeeker);
    }

    @Override
    public PageInfo findByJobSeekerPage ( JobSeekerVo jobSeekerVo ) {
        PageHelper.startPage ( jobSeekerVo.getPageNum ( ),jobSeekerVo.getPageSize ( ) );
        List<JobSeekerVo> list = excelResumeDao.findByJobSeekerPage ( jobSeekerVo );
        PageInfo pageInfo = new PageInfo ( list );
        return pageInfo;
    }

    @Override
    public List<JobSeeker> selectJobSeeker() {
        return excelResumeDao.selectJobSeeker();
    }

    @Override
    public int addTemplateResume(ResumeTemplate resumeTemplate) {
        return excelResumeDao.addTemplateResume(resumeTemplate);
    }

    @Override
    public List<ResumeTemplate> selectTemplate() {
        return excelResumeDao.selectTemplate();
    }

    @Override
    public JobSeeker selectByCallPhone(String callPhone) {
        return excelResumeDao.selectByCallPhone(callPhone);
    }

    @Override
    public ResumeTemplate selectByResumeNo(String resumeNo) {
        return excelResumeDao.selectByResumeNo(resumeNo);
    }

    @Override
    public int updateResumeNo(JobSeeker jobSeeker) {
        return excelResumeDao.updateResumeNo(jobSeeker);
    }

    @Override
    public JobSeeker selectSeekerByResumeNo(String resumeNo) {
        return excelResumeDao.selectSeekerByResumeNo(resumeNo);
    }

    @Override
    public ResumeTemplate selectByResumeCallPhone(String callPhone) {
        return excelResumeDao.selectByResumeCallPhone(callPhone);
    }

    @Override
    public List<JobSeeker> selectBySelectModel(SelectModel selectModel) {
        PageHelper.startPage(selectModel.getPageNum(),selectModel.getPageSize());
        return excelResumeDao.selectBySelectModel(selectModel);
    }
}
